﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MS.InformationManagement.DAL.DocumentCenter;
using Microsoft.SharePoint;
using MS.InformationManagement.Support.Constants;

namespace MS.InformationManagement.DAL.DTOs
{
    public class EntityContactDTO : BaseContactDTO<Entidades>
    {
        #region Constructors

        public EntityContactDTO(SPListItemCollection items) : base(items) { }

        #endregion

        #region Implemented Methods

        public override IEnumerable<Entidades> GetEntities()
        {

            IEnumerable<Entidades> entidades = from item in this._foundedItems.OfType<SPListItem>()
                                               select new Entidades
                                               {
                                                  ID = item[CustomSiteColumns.FLD_CONTACT_ID] +"",
                                                  RazónSocial = item[CustomSiteColumns.FLD_CONTACT_BUSINESS_NAME] + "",
                                                  Representante = item[CustomSiteColumns.FLD_CONTACT_REPRESENTATIVE] + "",
                                                  Teléfono = item[CustomSiteColumns.FLD_CONTACT_PHONE] + "",
                                                  Email = item[CustomSiteColumns.FLD_CONTACT_EMAIL] + "",
                                                  Dirección = item[CustomSiteColumns.FLD_CONTACT_ADDRESS] + "",

                                               };
            return entidades;
        }

        #endregion
    }
}
